import { createI18n } from "vue-i18n";
import zh from "./lang/zh";
import en from "./lang/en";
import zhCN from "vxe-table/lib/locale/lang/zh-CN";
import enUS from "vxe-table/lib/locale/lang/en-US";
const language = localStorage.getItem("lang");

const messages = {
  zh: {
    ...zhCN,
    ...zh,
  },
  en: {
    ...enUS,
    ...en,
  },
};

const i18n = createI18n({
  legacy: false,
  locale: language || "zh", // 初始化配置语言
  messages,
});

export default i18n;
